<template>
  <div>
    <div align="left">我的位置&gt;&gt;科技项目申报&gt;项目详细信息</div>
    <div id="container">
      <div id="content2">
        <table width="100%" height="41" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="4" colspan="2" align="left" valign="bottom"></td>
          </tr>
          <tr>
            <td height="15" align="left" valign="top">&nbsp;</td>
            <td height="15" align="left" valign="top" class="12">
              <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="20" align="center">
                    <div class="right_proaducts">
                    </div>
                    <DIV class=padding>
                      <DIV id=middlebody>
                        <table width="50%" border="0" cellpadding="0" cellspacing="1">
                          <input type="hidden" value="6" name="projectId"/>
                          <input type="hidden" value="4" name="categoryid"/>
                          <tbody>
                          <tr>
                            <td width="21%" bgcolor="#f3f3f3">
                              <div align="right">项目名称</div>
                            </td>
                            <td width="2%" bgcolor="#f3f3f3">&nbsp;</td>
                            <td width="77%" bgcolor="#f3f3f3">
                              <div align="left">{{ projectInfo.projectname }}</div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="#f3f3f3">
                              <div align="right">申请单位</div>
                            </td>
                            <td bgcolor="#f3f3f3">&nbsp;</td>
                            <td bgcolor="#f3f3f3">
                              <div align="left">{{ unitName }}</div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="#f3f3f3">
                              <div align="right">申请人</div>
                            </td>
                            <td bgcolor="#f3f3f3">&nbsp;</td>
                            <td bgcolor="#f3f3f3">
                              <div align="left">{{ projectInfo.applicant }}</div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="#f3f3f3">
                              <div align="right">职称</div>
                            </td>
                            <td bgcolor="#f3f3f3">&nbsp;</td>
                            <td bgcolor="#f3f3f3">
                              <div align="left">{{ projectInfo.grade }}</div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="#f3f3f3">
                              <div align="right">学历</div>
                            </td>
                            <td bgcolor="#f3f3f3">&nbsp;</td>
                            <td bgcolor="#f3f3f3">
                              <div align="left">{{ projectInfo.education }}</div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="#f3f3f3">
                              <div align="right">填报时间</div>
                            </td>
                            <td bgcolor="#f3f3f3">&nbsp;</td>
                            <td bgcolor="#f3f3f3">
                              <div align="left">{{ projectInfo.fillDate }}</div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="#f3f3f3">
                              <div align="right">项目现状</div>
                            </td>
                            <td bgcolor="#f3f3f3">&nbsp;</td>
                            <td bgcolor="#f3f3f3">
                              <div align="left">{{ projectInfo.expertOpinion }}</div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="#f3f3f3">
                              <div align="right">项目前景</div>
                            </td>
                            <td bgcolor="#f3f3f3">&nbsp;</td>
                            <td bgcolor="#f3f3f3">
                              <div align="left">{{ projectInfo.future }}</div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="#f3f3f3">
                              <div align="right">重难点分析</div>
                            </td>
                            <td bgcolor="#f3f3f3">&nbsp;</td>
                            <td bgcolor="#f3f3f3">
                              <div align="left">{{ projectInfo.analysis }}</div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="#f3f3f3">
                              <div align="right">研究方法</div>
                            </td>
                            <td bgcolor="#f3f3f3">&nbsp;</td>
                            <td bgcolor="#f3f3f3">
                              <div align="left">{{ projectInfo.way }}</div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="#f3f3f3">
                              <div align="right">预计研究成果</div>
                            </td>
                            <td bgcolor="#f3f3f3">&nbsp;</td>
                            <td bgcolor="#f3f3f3">
                              <div align="left">{{ projectInfo.result }}</div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="#f3f3f3">
                              <div align="right">申请资金</div>
                            </td>
                            <td bgcolor="#f3f3f3">&nbsp;</td>
                            <td bgcolor="#f3f3f3">
                              <div align="left">{{ projectInfo.capital }}</div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="#f3f3f3">
                              <div align="right">专家评审意见</div>
                            </td>
                            <td bgcolor="#f3f3f3">&nbsp;</td>
                            <td bgcolor="#f3f3f3">
                              <div align="left">
                              <textarea id="opinion" name="expertOpinion"
                                        v-model="projectInfo.expertOpinion"></textarea>
                              </div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="#f3f3f3">
                              <div align="right">专家评分</div>
                            </td>
                            <td bgcolor="#f3f3f3">&nbsp;</td>
                            <td bgcolor="#f3f3f3">
                              <div align="left">
                                <input id="score" name="score" v-model="projectInfo.score"/>
                              </div>
                            </td>
                          </tr>
                          <tr>
                            <td colspan="2" align="middle" bgcolor="#f3f3f3">&nbsp;</td>
                            <td height="30" align="middle" bgcolor="#f3f3f3">
                              <div align="left">
                                <input name="submit" type="button" @click="submitInfo()" value="提交"/>
                              </div>
                            </td>
                          </tr>
                          </tbody>
                        </table>
                      </div>
                    </div>
                  </td>
                </tr>
              </table>
              <br/>
              <div class="table_wz"></div>
            </td>
          </tr>
        </table>
      </div>
      <div id="container">
        <div id="footer">
          <p><a href="http://www.ascenttech.com.cn/" target="_blank">版权所有：北京亚思晟商务科技有限公司
            &copy;2004-2008|京ICP备05005681</a>
          </p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "showProjectInfo",
  data() {
    return {
      projectInfo: {},
      unitName: '',
    }
  },
  mounted() {
    this.getPid();
    this.selectProject();
  },
  methods: {
    //注销
    logout() {
      sessionStorage.clear();
    },
    //获取项目projectId
    getPid() {
      var strings = window.location.href.split('?')[1];
      let getCid = new URLSearchParams('?' + strings)  //将参数放在URLSearchParams函数中
      let pid = getCid.get('pid');
      // console.log(pid);
      return pid;
    },
    //获取项目信息
    selectProject() {
      var _this = this;
      this.$axios({
        url: `http://localhost:8080/api/expert/select/projectInfo/${_this.getPid()}`,
        method: 'get',
      }).then((res) => {
        // console.log(res);
        // console.log(res.data.data);
        if (res.data.code == 200) {
          _this.unitName = res.data.data.unitName;
          _this.projectInfo = res.data.data.projectInfo;
        }
      })
    },
    submitInfo() {
      var _this = this;
      this.$axios({
        url: `http://localhost:8080/api/expert/submitProjectInfo`,
        method: 'post',
        data: _this.projectInfo
      }).then((res) => {
        if (res.data.code == 200) {
          alert("修改成功");
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
